package com.zhz.livegoods.details.controller;

import com.zhz.livegoods.details.service.DetailsService;
import com.zhz.livegoods.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品详情控制器
 * @author zhz
 * @date 2020/08/05
 **/
@RestController
@CrossOrigin
public class DetailsController {
    @Autowired
    private DetailsService detailsService;

    /**
     * 根据id查询商品详情
     * @param id
     * @return
     */
    @GetMapping("/details")
    public Item findById(String id){
        return detailsService.getDetails(id);
    }

}
